package org.seckill.dto;

import org.seckill.common.Const;
import org.seckill.entity.SuccessKilled;

/**
 * @author Elmer
 * @create 2017-07-30 11:57
 * @desc 封装秒杀执行后结果
 **/
public class SeckillExecution {
    //秒杀商品ID
    private Long seckillId;
    //秒杀状态
    private int status;
    //状态标识
    private String statusInfo;
    //秒杀成功对象
    private SuccessKilled successKilled;

    public SeckillExecution(Long seckillId, Const.SeckillStatusEnum statusEnum, SuccessKilled successKilled) {
        this.seckillId = seckillId;
        this.status = statusEnum.getCode();
        this.statusInfo = statusEnum.getDesc();
        this.successKilled = successKilled;
    }

    public SeckillExecution(Long seckillId,Const.SeckillStatusEnum statusEnum) {
        this.seckillId = seckillId;
        this.status = statusEnum.getCode();
        this.statusInfo = statusEnum.getDesc();
    }

    public Long getSeckillId() {
        return seckillId;
    }

    public void setSeckillId(Long seckillId) {
        this.seckillId = seckillId;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getStatusInfo() {
        return statusInfo;
    }

    public void setStatusInfo(String statusInfo) {
        this.statusInfo = statusInfo;
    }

    public SuccessKilled getSuccessKilled() {
        return successKilled;
    }

    public void setSuccessKilled(SuccessKilled successKilled) {
        this.successKilled = successKilled;
    }

    @Override
    public String toString() {
        return "SeckillExecution{" +
                "seckillId=" + seckillId +
                ", status=" + status +
                ", statusInfo='" + statusInfo + '\'' +
                ", successKilled=" + successKilled +
                '}';
    }
}
